#ifndef CATROWWIDGET_H
#define CATROWWIDGET_H

#include <QtSql>
#include <QtGui>

#include "ui_catrowwidget.h"

class CatRowWidget : public QWidget, private Ui::CatRowWidget
{
Q_OBJECT

public:

CatRowWidget( QMap<QString, QStringList> opened_album_attrs_ );
~CatRowWidget();

public slots:

void new_record( qint64 coin_id, QString opened_album );
void save_clicked();
QSqlRecord read_record(QSqlRecord record);
void set_record( QSqlRecord record,
                 QModelIndex index );
signals:

void record_to_commit( QSqlRecord record,
                       QModelIndex index,
                       QLatin1String id,
                       bool new_record );

private:

void writeSettings();
void readSettings();
QMap<QString, QStringList> opened_album_attrs;
QSqlRecord current_record;
QModelIndex current_index;
bool is_new;

protected:

void closeEvent( QCloseEvent * e );

};

#endif // CATROWWIDGET_H
